﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace ZLDC.Estate.UserControl
{
    public partial class Dept_Tree : System.Web.UI.UserControl
    {
        public string sTopDept = string.Empty;//默认取表中第一行为最上层部门
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AddDeptTree();
            }
        }
        /// <summary>
        /// 选择部门树形菜单
        /// </summary>
        private void AddDeptTree()
        {
            string sLimtDeptIdList;

            sLimtDeptIdList = string.Empty;//全部制  
            if (string.IsNullOrEmpty(sTopDept))
            {
                sTopDept = ConfigurationSettings.AppSettings["SalesDepartment"].ToString().Trim();//最上层部门
            }

            ZLDC.Topo.BLL.Estate.DeptTree zdt = new ZLDC.Topo.BLL.Estate.DeptTree(sTopDept, sLimtDeptIdList);
            ltlDeptTree.Text = zdt.GetZlhqDept();
        }
    }
}